<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
?>
<div class="row" style="width:680px">
  <div class="col-lg-12">
    <section class="panel">
      <div class="panel-body" style="padding:5px">
        <div class="row text-small">
          <form id="form_search" target="_self">
            <div class="form-group">
                <div class="col-sm-4">
                  <input type="text" readonly="" onclick="new Calendar().show(this);" value="" class="form-control" placeholder="开始时间" name="stime" id="stime">
                </div>
                <div class="col-sm-4">
                  <input type="text" readonly="" onclick="new Calendar().show(this);" value="" class="form-control" placeholder="结束时间" name="etime" id="etime">
                </div>
            </div>
            <div class="col-sm-3 input-group"> <span class="input-group-btn">
              <button class="btn btn-sm btn-white" type="submit">搜索</button>
              </span> </div>
          </form>
        </div>
      </div>
      <div class="table-responsive" id="show-data-list">
        <?php include getTpl('detail');?>
      </div>
    </section>
  </div>
</div>
<!----> 
<script>
var uid=<?php echo $uid;?>;
var type='<?php echo $type;?>';
$(function(){
	$("#form_search").submit(function(){
		var stime=$("#stime").val();
		var etime=$("#etime").val();
		if (!stime||!etime){
			Msg.error('请输入起止时间');
			return false;
		}
		loadData('<?php echo U('credit/index');?>',{"uid":uid,"stime":stime,"etime":etime,"is_ajax":1,"type":type});
		return false;
	});
	function loadData(url,data){
		Msg.loading();
		$.getJSON(url,data,function(result){
			Msg.hide();
			if (result.status==1){
				$("#show-data-list").html(result.data);
			}else{
				Msg.error(result.info);
			}	
		});	
	}
	$("#show-data-list").delegate('#ajax_pagebox a','click',function(){
		loadData($(this).attr('rel'),{"is_ajax":1});
	});
})
</script>